let v = new Vue({
    el: '#app',
    data: function () {
        return {
            currentIndex: "1",
            productArr: [{
                title: "森马牛仔裤女宽松慢跑裤运动风2022春季新款显瘦束脚长裤复古",
                price: 233,
                oldPrice: 598,
                url: "imgs/a.jpg",
                saleCount: 2342
            },
                {
                    title: "茵曼马甲连衣裙两件套春季新款娃娃领色织格长袖背心裙套装",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/b.jpg",
                    saleCount: 2342
                },
                {
                    title: "雪中飞墨绿色短袖t恤女夏2022新款纯棉半袖打底体恤夏季上衣潮ins",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/c.jpg",
                    saleCount: 2342
                },
                {
                    title: "【佟丽娅同款】鸭鸭明星同款羽绒服2021年冬季新款时尚连帽外套冬",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/d.jpg",
                    saleCount: 2342
                },
                {
                    title: "BEASTER小恶魔鬼脸明星同款夹克毛绒保暖加厚字母印花宽松外套ins",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/e.jpg",
                    saleCount: 2342
                },
                {
                    title: "香影毛呢外套女中长款2021年冬季新款气质韩版娃娃领紫色呢子大衣",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/f.jpg",
                    saleCount: 2342
                },
                {title: "SEMIR森马商场同款打底针织毛衣纯色高领新品显瘦", price: 233, oldPrice: 598, url: "imgs/g.jpg", saleCount: 2342},
                {
                    title: "美特斯邦威女MTEE 贺岁系列中长款风衣736598",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/h.jpg",
                    saleCount: 2342
                },
                {
                    title: "imone2021秋款黑色小西装外套女韩版学生宽松学院风外套jk外套",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/i.jpg",
                    saleCount: 2342
                },
                {
                    title: "BEASTER 小恶魔明星同款保暖长袖街头潮流连帽卫衣情侣上衣",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/j.jpg",
                    saleCount: 2342
                },
                {
                    title: "憨厚皇后100%绵羊皮2021秋海宁真皮皮衣女长款修身绵羊皮风衣外",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/k.jpg",
                    saleCount: 2342
                },
                {
                    title: "美特斯邦威高腰牛仔裤女宽松小脚新款春秋彩色潮流女士牛仔",
                    price: 233,
                    oldPrice: 598,
                    url: "imgs/a.jpg",
                    saleCount: 2342
                }],
            categoryArr: [{id: 1, name: "精彩活动"}, {id: 2, name: "精品女装"},
                {id: 3, name: "品牌男装"}, {id: 4, name: "母婴产品"}],
            bannerArr: [{id: 1, url: "imgs/b1.jpg"}, {id: 2, url: "imgs/b2.jpg"},
                {id: 3, url: "imgs/b3.jpg"}],

        }
    },
    methods: {
        closemenu(){
            let asideclose = document.getElementById("aside");
            let buttonclosehide = document.getElementById("closem");
            let buttonopenblock = document.getElementById("openm");
            asideclose.style.width="50px";
            buttonclosehide.style.display="none";
            buttonopenblock.style.display="block";
        },
        openmenu(){
            let asideopen = document.getElementById("aside");
            let buttonopenhide = document.getElementById("openm");
            let buttoncloseblock = document.getElementById("closem");
            asideopen.style.width="200px";
            buttonopenhide.style.display="none";
            buttoncloseblock.style.display="block";
        },

        handleSelect(key, keyPath) {
            //key就是导航菜单项的index的值
            v.currentIndex = key;
        },
        handleCategoryDelete(i, c) {
            v.categoryArr.splice(i, 1);
            v.$message.success("成功删除 " + c.name);
        },
        handleBannerDelete(i, b) {
            v.bannerArr.splice(i, 1);
            v.$message.success("成功删除轮播图");
        },
        handleProductDelete(i, p) {
            v.productArr.splice(i, 1);
            v.$message.success("成功删除 " + p.title);
        },

    }
})